package network;

import java.net.SocketException;
import java.util.HashMap;

public class UdpDictServer extends UdpEchoServer{
    private HashMap<String,String> dict = null;
    public UdpDictServer(int port) throws SocketException {
        super(port);
        dict.put("hello","你好");
        dict.put("hello","你好");
        dict.put("hello","你好");
        dict.put("hello","你好");
        dict.put("hello","你好");
    }

//    重写process方法
    @Override
    public String process(String request){
        return dict.getOrDefault(request,"该词汇没有查询到");
    }
}
